import Request from '@/request'

export const getAddress = <T extends object, R>(
  data: T
): Promise<IResponse<IList<R>>> => {
  return Request.get('/addresses/address', data)
}

export const addAddress = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/addresses/add', data)
}

export const updateAddress = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.post('/addresses/update', data)
}

export const getAddressDetail = <T extends object, R>(
  data: T
): Promise<IResponse<R>> => {
  return Request.get('/addresses/address', data)
}
